package com.yaj.mesif.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yaj.mesif.dto.ToOrderDto;
import com.yaj.mesif.entity.ToCanOrder;
import com.yaj.mesif.entity.ToOrder;
import com.yaj.mesif.mapper.ToOrderMapper;
import com.yaj.mesif.service.ToOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wei
 * @since 2021-08-24
 */
@Service
public class ToOrderServiceImpl extends ServiceImpl<ToOrderMapper, ToOrder> implements ToOrderService {
    @Resource
    private ToOrderMapper toOrderMapper;

    @Override
    public List<ToOrder> GetToOrderList() {
        List<ToOrder> toOrders = toOrderMapper.selectList(new QueryWrapper<ToOrder>().lambda().eq(ToOrder::getProcessflag,"0").orderByAsc(ToOrder::getWipordernumber,ToOrder::getSeqNo));
        return toOrders;
    }

    @Override
    public void ifo1004InsertToOrder(ToCanOrder toCanOrder) {
        toOrderMapper.ifo1004InsertToOrder(toCanOrder);
    }

    @Override
    public List<ToOrderDto> ifo1005SelectToOrder() {
        return toOrderMapper.ifo1005SelectToOrder();
    }

    @Override
    public int ifo1005UpdateToOrder(ToOrderDto toOrderDto) {
        return toOrderMapper.ifo1005UpdateToOrder(toOrderDto);
    }
}
